<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/21
 * Time: 10:24
 */

namespace app\api\validate;


class Appointment extends BaseValidate
{
    protected $rule = [
        'id' => 'require|isPositiveInteger',
        'date' => 'require|date',
        'time' => 'require|date',
        'num' => 'require|isPositiveInteger',
        'name' => 'require|chsAlpha',
        'tel' => 'require|isMobile',
        'remark' => 'chsAlphaNum|max:150',
        'reason' => 'require|length:4,150'
    ];

    protected $message = [
        'reason.length'  =>  '理由请在4-150字符之间',
    ];

    protected $scene = [
        'add'  =>  ['date','time','num','name','tel','remark'],
        'cancel'  =>  ['reason','id'],
    ];

}